package com.cellulam.framework.scheduled;


import com.cellulam.framework.core.enums.CodeDescriptionFeature;
import com.cellulam.framework.core.utils.EnumHelper;
import lombok.Getter;

/**
 * 任务执行策略
 */
@Getter
public enum TaskStrategy implements CodeDescriptionFeature {

    /**
     * 有序执行
     */
    SEQUENCE(1, "有序执行"),
    /**
     * 并行执行
     */
    PARALLEL(2, "并行执行");

    private final int code;
    private final String description;

    TaskStrategy(int code, String description){
        this.code = code;
        this.description = description;
    }

    public static TaskStrategy valueOf(int code){
        return EnumHelper.valueOf(code, TaskStrategy.class);
    }
}
